<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ include file="/WEB-INF/component/commonTagLib.jsp" %>
<!DOCTYPE html>
<html>
<head>
    <title><spring:message code="message.jieSuan.jieSuanDan"/><spring:message code="message.jqGrid.cz.xiangQing"/></title>
    <%@ include file="/WEB-INF/component/commonCSS.jsp"%>
    <style type="text/css">
        div.group-info {
            margin-top: 10px !important;
            margin-bottom: 0px !important;
        }
        input.innerInput {
            width: 98%;
        }
    </style>
</head>
<body class="skin-blue sidebar-mini fixed skin-blue-light-frame">
    <section class="content-header">
        <h1><spring:message code="message.jieSuan.jieSuanDan"/><spring:message code="message.jqGrid.cz.xiangQing"/></h1>
         <ol class="breadcrumb">
            <li><a href="${ctx}/home.jsp"><i class="fa fa-home"></i><spring:message code="message.lable.first"/></a></li>
            <li class="active"><a href="#"><spring:message code="message.jieSuan.zhiFuDanGuanLi"/></a></li>
            <li class="active"><a href="#"><spring:message code="message.jieSuan.zhiFuDan"/><spring:message code="message.jqGrid.cz.audit"/></a></li>
        </ol>
     </section>
     
     <section class="content" style="min-height:inherit;">
          <form id="form" class="form-horizontal"  method="post">
            <input type="hidden" name=settlementId value="${info.settlementId}" />
            
	        <div class="box box-success" style="margin-bottom: 0px;padding-bottom: 10px;">
	           <div class="form-group form-group-xs group-info">
	                 <label for="inputTextAlter1" class="col-sm-2 text-right"><spring:message code="message.jieSuan.jieSuanDan"/><spring:message code="message.yanZheng.bianMa"/><spring:message code="message.yanZheng.maoHao"/></label>
	                 <div class="col-sm-4 text-left" >${info.settlementCode}</div>
	                 <label for="inputTextAlter2" class="col-sm-2 text-right"><spring:message code="message.jieSuan.jieSuanDan"/><spring:message code="message.listForm.mingCheng"/><spring:message code="message.yanZheng.maoHao"/></label>
	                 <div id="orgName" class="col-sm-4 text-left">${info.settlementName}</div>
	            </div>
	             
	            <div class="form-group form-group-xs group-info">
                     <label for="inputTextAlter1" class="col-sm-2 text-right"><spring:message code="message.jieSuan.zongTiaoMuShu"/><spring:message code="message.yanZheng.maoHao"/></label>
                     <div id="outstandAmt" class="col-sm-4 text-left">${info.totalOrders}</div>
                     <label for="inputTextAlter2" class="col-sm-2 text-right"><spring:message code="message.jieSuan.zongJinE"/><spring:message code="message.yanZheng.maoHao"/></label>
                     <div id="availableAmt" class="col-sm-4 text-left">${info.totalAmount}</div>
                </div>
                
                <div class="form-group form-group-xs group-info">
                     <label for="inputTextAlter1" class="col-sm-2 text-right"><spring:message code="message.lable.remark"/><spring:message code="message.yanZheng.maoHao"/></label>
                     <div id="pendingAmt" class="col-sm-4 text-left">${info.remarks}</div>
                     <label for="inputTextAlter2" class="col-sm-2 text-right"><spring:message code="message.lable.status"/><spring:message code="message.yanZheng.maoHao"/></label>
                     <div id="pendingAmt" class="col-sm-4 text-left">${info.status}</div>
                </div> 
                
	        </div>
        </form>
     </section>
    
    
    <section class="content">
        <div class=" box box-success">
            <div class="box-body">
                <div class=" form-inline">
                    <div class="form-group form-group-xs">
                        <label for="name"><spring:message code="message.listForm.yiLiaoJiGouMingCheng"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <input class="form-control" type="text" id="hospName" placeholder="<spring:message code="message.listForm.yiLiaoJiGouMingCheng"/>" maxlength="100" />
                    </div>
                	
                    <button    id="selectWSJ"   type="button" class="btn btn-success btn-sm" onclick="gridSerch();"><spring:message code="message.button.seachSpacing"/></button>
                    
                </div>
            </div>
        </div>
        
        <table class="jqgrid" id="gridlist"></table>
		<div id="gridpage"></div>
		<div class=" box box-warning bottongroup">
			<button type="button" onclick="window.location.href='${ctx}/centerCheckPayment/toCenterCheckSetPaymentDetailList.html?paymentBillId=${payment.paymentBillId}'" class="btn btn-default btn-sm"><spring:message code="message.button.getBackSpacing"/></button>

		</div>
   </section> 
    
   <%@ include file="/WEB-INF/component/commonJS.jsp"%>
   <script type="text/javascript">
   
   //加载页面光标在名字框内，位于第一个
   $("#hospName").focus();
   
 //绑定回车    id="selectWSJ"  
   $('#hospName').bind('keydown', function(event) {
       if (event.keyCode == "13") {        //13 位电脑上回车键的位置代码
           $('#selectWSJ').click();
       }
   }); 
   
   
		 $(function() {
			 
			 jQuery("#gridlist").jqGrid({
	    			url: "${ctx}/centerCheckPayment/getCenterCheckSetmentDetailList.html?settlementId=${payment.settlementId}",
	    		    mtype: "POST",
	    			datatype: "json",
	    			autowidth: true,
	    			shrinkToFit: false,
	    			height: 270,
	    		   	colNames:[ 
                            '<spring:message code="message.jqGrid.cz"/>',
	    		   	        'settlementDetailId',
	    		   	        '<spring:message code="message.jieSuan.jieSuanDan"/>ID',
                            '<spring:message code="message.jieSuan.jieSuanDan"/><spring:message code="message.yanZheng.bianMa"/>',
                            '<spring:message code="message.jieSuan.jieSuanDan"/><spring:message code="message.listForm.mingCheng"/>',
                            '<spring:message code="message.listForm.TiaoMuShu"/>',
                            '<spring:message code="message.jieSuan.zongJinE"/>',
                            '<spring:message code="message.listForm.yiLiaoJiGouMingCheng"/>',
                            '<spring:message code="message.lable.remark"/>',
                            '<spring:message code="message.jieSuan.tiJiaoRen"/>',
                            '<spring:message code="message.jieSuan.tiJiaoShiJian"/>'
	    		   	          
	    		   	           ],
	    		   	colModel:[
						{ name: 'oper', width:60, align:"center", sortable:false,
						    formatter : function(val, opts, rowdata) {
						    var str = "";
						    str += "<a href='${ctx}/centerCheckPayment/toCenterSetPaymentDetailList.html?paymentBillId=${payment.paymentBillId}&settlementId="+rowdata.settlementId+"&settlementId2=${payment.settlementId}'><spring:message code="message.jqGrid.cz.xiangQing"/></a>";
						    return str;
						    }  
						},
						{ name: 'settlementDetailId', width:160,hidden:true,align:"center" ,sortable:false},
						{ name: 'settlementId', width:160,hidden:true,align:"center" ,sortable:false},
						{ name: 'settlementCode', width:160,align:"center" ,sortable:false}, 
						{ name: 'settlementName', width:160,align:"left" ,sortable:false}, 
						{ name: 'totalOrders', width:80,align:"center" ,sortable:false},
						{ name: 'totalAmount', width:100,align:"right" ,sortable:false,
							formatter :function(val){
								return formatAmount(val,null,null);
							}},
						{ name: 'hospName', width:160,align:"left" ,sortable:false,
								 formatter:function(cellvalue, options,row) {
										return "<a href=\"javascript:$.HN.dialog.opendialog('"+row.hospId+"','"+cellvalue+"','${ctx}/stdHospInfo/hospInfoDetail.html?hospId="+row.hospId+"','800px','400px',function operResult(val){return operResult;})\">"+cellvalue+"</a>";
								}	
						},      
						{ name: 'remarks', width:160,align:"left" ,sortable:false},       
						{ name: 'submitUser', width:160,align:"left" ,sortable:false},      
	    				{ name: 'submitDatetime', width:160,align:"center" ,sortable:false}
						
	    				
	    		   	],
	    			 rowNum: 20,
	    		     rowList: [10, 20, 50, 100],
	    		     rownumbers: true,
	    		     pager: "#gridpage",
	    		     viewrecords: true,
	    		     multiselect: true, 
	    		     caption: "<spring:message code="message.jieSuan.jieSuanDanMingXi"/><spring:message code="message.listForm.lieBiao"/>",
	    		   //序号宽度自动变化
	                 gridComplete:function(){
	                     //序号列宽度自适应（参数为jqgridID）
	                     autoRNWidth("gridlist");
	                     //数据只有一条时默认选中（参数为jqgridID）
	                     selectByOneData("gridlist");
	                 },
	    		     jsonReader: {
	    		         repeatitems: false,
	    		         id: "settlementDetailId"
	    		     }
	    		});
	            
	            $("#gridlist").jqGrid('navGrid', '#gridpage', { add: false, edit: false, del: false, search: false, refresh: false });
	            
	            $(window).trigger("resize");
			
	            
	        });
			   
		
		 //查询
	        function gridSerch() {
	        	var hospCode = $.trim($("#hospCode").val());
	        	var hospName = $.trim($("#hospName").val());
	    		$("#gridlist").jqGrid('setGridParam',{  
	    	        datatype:'json',
	    	        postData:{
	    	        		"hospCode":hospCode,
	    	        		"hospName":hospName,
	    	        		},
	    	        		page:1
	    	    }).trigger("reloadGrid"); //重新载入  
	    	}
		   
			
	</script>
</body>
</html>